﻿using CinemaMaestro.BusinessLayer;
using CinemaMaestro.BusinessLayer.Contracts;
using CinemaMaestro.DataLayer.Contracts;
using CinemaMaestro.DataLayer.Entity;
using StructureMap;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CinemaMaestro.Common.IocContainer
{
    public static class Resolver
    {
        private static Container _container;

        static Resolver()
        {
            _container = new Container(x =>
            {
                x.For<IUnitOfWork>().Add<UnitOfWork>();
                x.For<IBusinessObjectFactory>().Add<BusinessObjectFactory>();
            });
        }

        public static T Get<T>()
        {
            return _container.GetInstance<T>();
        }
    }
}
